home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Otherware
/
Otherware_1_SB_Development.iso
/
mac
/
hypercar
/
xfcn
/
spttool.cpt
/
Support Tools eXternals 1.2.5
/
card_36512.txt
< prev
next >
Wrap
Text File
|
1990-11-13
|
5KB
|
158 lines
-- card: 36512 from stack: in.5
-- bmap block id: 43181
-- flags: 0000
-- background id: 3858
-- name: MenuShowing
----- HyperTalk script -----
on HideObjects
hide cd btn "Try It!"
end HideObjects
on ShowObjects
show cd btn "Try It!"
end ShowObjects
-- part 1 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=82 top=185 right=219 bottom=175
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 8192
-- line height: 16
-- part name: Try it!
----- HyperTalk script -----
on mouseUp
global errGlobal
put MenuBarShowing() into mBarState
if errGlobal Γëá empty then
answer "Error: ΓÇ£" & errGlobal & "ΓÇ¥"
put empty into errGlobal
else
if mBarState = true then
put "is" into theVerb
else
put "is not" into theVerb
end if
answer "The menu bar" && theVerb && "visible."
end if
end mouseUp
-- part contents for background part 38
----- text -----
28/50
-- part contents for background part 20
----- text -----
Indicates whether the menubar is currently showing. HyperCard allows users and scripters to hide or show the menu bar (ie. "hide menubar" or "show menubar") but no way to test it's state.
Calling syntax : MenuBarShowing(<ΓÇ£noDialogΓÇ¥:errorGlobal>)
Returns "TRUE" or "FALSE".
-- part contents for background part 42
----- text -----
unit MenuBarShowing;
{}
{ Test to see if the menubar is showing. Look at the height of the menu bar, see if > 0.}
{}
{ brought to you by: Anup Murarka Eric Carlson }
{ ALINK: SKEPTIC ALINK: cyNic }
{ CIS: 76004,3356 }
{}
{ We are part of the Support Tools Development Group, }
{ Apple Computer, Inc. }
{}
{ please DO NOT contack Mac DTS for support of this code! }
{}
{ please DO contact the authors for support of this code! }
{}
{ Send comments, bug reports, requests to any of the above }
{ E-mail addresses or to:}
{}
{ (one of us) }
{ Apple Computer, Inc. }
{ 900 E. Hamilton, Ave. }
{ Campbell, CA 95008 }
{ M/S 72-L }
{}
{ Copyright: © 1989, 1990 by Apple Computer, Inc., all rights reserved. }
{}
{ written by Eric Carlson }
{ AppleLink: cyNic }
{ modification history }
{ Date Initials Comments }
{ ---- ------ ------------------------------------------------------}
{ 7/27/89 ec first written }
{ 8/29/90 ec modified use GetMBarHeight function rather than low mem }
{ global. changed version to 1.1 }
{}
interface
uses
HyperXCMD;
procedure main (paramPtr: XCmdPtr);
implementation
function askedForHelp (paramPtr: XCmdPtr; syntaxMsg: Str255; copyRightMsg: Str255): boolean;
{}
{ check to see if the user sent a '?' or a '!' as }
{ the only parameter. if so we will respond with }
{ the calling syntax or the copyright/version info }
{ for this external }
{}
var
firstStr: str255;
begin
askedForHelp := false;
if paramPtr^.paramCount = 1 then
begin
ZeroToPas(paramPtr, paramPtr^.params[1]^, firstStr);
{ what is the first param? }
if firstStr = '?' then
begin
paramPtr^.returnValue := PasToZero(paramPtr, syntaxMsg);
askedForHelp := true
end { asked for help }
else if firstStr = '!' then
begin
paramPtr^.returnValue := PasToZero(paramPtr, copyRightMsg);
askedForHelp := true
end; { asked for copyright info }
end; { one parameter passed }
end; { function }
function GetMBarHeight: INTEGER;
inline
$3EB8, $0BAA;
procedure MenuIsShowing (paramPtr: XCMDPtr);
var
menuShowing: boolean;
copyRtStr, syntaxStr: str255;
begin
syntaxStr := 'MenuBarShowing()';
copyRtStr := 'v1.1, ©1989, 1990 Apple Computer, Inc., by Eric Carlson';
if not (askedForHelp(paramPtr, syntaxStr, copyRtStr)) then
begin
menuShowing := (GetMBarHeight > 0);
BoolToStr(paramPtr, menuShowing, syntaxStr); { borrow the string var… }
paramPtr^.returnValue := PasToZero(paramPtr, syntaxStr);
end;
end;
procedure main (paramPtr: XCmdPtr);
begin
MenuIsShowing(paramPtr);
end;
end.